package top.yudoge.dogeeditor.db.service

import top.yudoge.dogeeditor.db.objects.Schema
import java.sql.Connection

class MySQLVendorBridge : SQLVendorBridge {

    override fun move(connection: Connection, databaseName: String, schemaName: String) {
        connection.createStatement().use {
            it.execute("USE $databaseName")
        }
    }

    override fun schemaList(connection: Connection, dataSourceIdentifier: String, databaseName: String): List<Schema> {
        return listOf(
            Schema(dataSourceIdentifier, databaseName, "%")
        )
    }
}